package hr.dao.impl;

import hr.dao.EmployeeDao;
import hr.models.Employee;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: VMoskalenko
 * Date: 13.07.12
 * Time: 14:13
 */
public class EmployeeDaoImpl implements EmployeeDao {
    @PersistenceContext
    EntityManager em;
    @Override
    public List<Employee> all() {
        return em.createQuery("select e from Employee e", Employee.class).getResultList();
    }

}
